package com.wing.res.model.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 产品工艺路线参数表_sku表
 * @version 1.1.0
 * @Author hz
 * @Date 2024-09-23 21:22
 **/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@TableName("res_benchmark_book_echnology_sku")
public class ResBenchmarkBookEchnologySku {


    /**
     * ID
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @TableId(type = IdType.AUTO)
    public Long id;

    /**
     * 版本号
     */
    @Version
    @JsonIgnore
    protected Long version;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    protected LocalDateTime createTime;

    /**
     * 创建者ID
     */
    private Long creator;

    /**
     * 创建者名称
     */
    private String creatorName;

    /**
     * 修改时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonIgnore
    protected LocalDateTime updateTime;

    /**
     * 修改者
     */
    protected Long modifier;

    /**
     * 修改者名称
     */
    private String modifierName;

    /**
     * 是否已删除
     */
    protected Boolean isDeleted;

    /**
     * 备注
     */
    protected String remark;

    /**
     * sku编码
     */
    @TableField(exist = false)
    protected String skuCode;

    /**
     * sku名称
     */
    @TableField(exist = false)
    protected String skuName;

    /**
     * sku规格
     */
    @TableField(exist = false)
    protected String skuSpec;

    /**
     * 剩余库存
     */
    @TableField(exist = false)
    protected BigDecimal haveQuantity;

    /**
     * 物料id
     */
    private Long productDetailId;

    /**
     * 需要数量
     */
    private BigDecimal quantity;

    /**
     * 关联工艺工序id
     */
    private Long echnologyId;


    @TableField(exist = false)
    private Long baseUnit;

    @TableField(exist = false)
    private String baseUnitName;

}
